<template>

    <mi-table :list="list">

        <template #orderStatus="{row}">
            <el-tag effect="plain" size="small">{{orderService.orderStatus[row.order_status]?.title }}</el-tag>
        </template>

    </mi-table>

</template>

<script setup lang="ts">


import {reactive} from "vue";
import List from "@/model/list";
import orderService from "@/service/order";

const props = withDefaults(defineProps<{
    where?:Record<string, any>
}>(),{
})

const list = reactive(new List({
    where: props.where ? {...props.where} : {},
    url: `/store.order/index`,
    size:'small',
    columns:[
        {name: "order_no", title:"订单号"},
        {name: "num", title:"商品数量"},
        {name: "total_price", title:'订单金额'},
        {name: "pay_price", title:'实付金额'},
        {name: "pay_price", title:'实付金额'},
        {name: "orderStatus", title:'订单状态', type:"slot", slot:"orderStatus"},
        {name: "create_time", title:'下单时间'},
    ]
}))

</script>

<style scoped>

</style>
